@use 'sass:map';
@use '@angular/material' as mat;

@mixin color($config-or-theme) {
  $config: mat.get-color-config($config-or-theme);
  $foreground: map-get($config, foreground);
  $primary: map-get($config, primary);

  .ngm-calculation__form-row {
    display: flex;
    flex-direction: row;
    place-content: center space-between;
  }

  .ngm-calculation-measure__formula-functions {
    .ngm-mdx-functions__function-option.mat-mdc-list-option {
      .mat-mdc-list-item-content.mat-mdc-list-item-content-reverse {
        .mat-mdc-list-text {
          padding-right: 0;
        }
      }
    }
    .mat-accordion.ngm-accordion {
      .mat-expansion-panel-body {
        padding: 0;
      }
    }
  }

  .ngm-mdx-functions__help-container.mat-mdc-menu-panel {
    max-width: 380px;
  }
}

@mixin typography($config-or-theme) {
}

@mixin density($config-or-theme) {
  ngm-calculation-editor {
    .mat-mdc-radio-button .mdc-radio {
      --mdc-radio-state-layer-size: 28px;
    }
  }

  .ngm-calculation__dimensions {
    margin-bottom: 0.5rem;
  }

  #ngm-calculated-parameters {
    .mat-mdc-list-item {
      .mat-mdc-list-item-content-reverse {
        padding-right: 0;
      }
    }
  }
}

@mixin theme($theme) {
  $color: mat.get-color-config($theme);
  $density: mat.get-density-config($theme);
  $typography: mat.get-typography-config($theme);

  @if $color != null {
    @include color($color);
  }
  @if $density != null {
    @include density($density);
  }
  @if $typography != null {
    @include typography($typography);
  }
}
